package com.whkjdx.examtool.config;

import feign.Logger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: xucong
 * @Date: 19:26 2022/1/31
 * @Description:
 * @Version v1.0
 */
@Configuration
public class FeignConfig {

    @Bean
    Logger.Level level(){
        return Logger.Level.FULL;
    }

    @Bean
    Logger logger(){
        return new FeignLogger();
    }

    @Slf4j
    static class FeignLogger extends Logger{


        @Override
        protected void log(String configKey, String format, Object... args) {
            log.info(String.format(methodTag(configKey) + format, args));
        }
    }
}
